<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

</body>
<script type="text/javascript">
    var shuffle_array = [1, 2, 1, 2, 3, 4, 1, 2, 3, 9, 8, 7, 7];
    // 数组去重
    function Toralds (arr) {
        for (var i = 0; i < arr.length - 1; i ++) {
            for (var j = i + 1; j < arr.length; j ++) {
                if (arr[i] == arr[j]) {
                    arr.splice(j, 1);
                    j --;
                }
            }
        }
        return arr;
    }
    console.log(Toralds(shuffle_array));
    var additionally = document.getElementsByTagName('a');
    var img = document.getElementsByTagName('img')[0];
    for (var i = 0; i < additionally.length; i ++) {
        additionally[i].onclick = function () {
            this.setAttribute('src', './statics/images/pricute' + this.getAttribute('index') + './jpg');
        }
    }
    // let 和 var
    function clcyOpen () {
        for (var i = 0; i < 10; i ++) {
            setTimeout(function (i) {
                console.log(i);
            }, 100, i)
        }
    }
    clcyOpen();
</script>
</html>